
<%@page import="cs236369.hw5.db.beans.DbMessage"%>
<%@page import="cs236369.hw5.db.DbHandler"%>
<%@page import="cs236369.hw5.db.DbHandlerImp"%>
<%@page import="cs236369.hw5.db.beans.DbUser"%>
<%@ page language="java" contentType="text/html; charset=windows-1255"
	pageEncoding="windows-1255"%>
<!DOCTYPE html>
<html>
<head>
<title>CrowdSourcing - user info</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<link rel="stylesheet" type="text/css" title="index_css"
	href="/${project.build.finalName}/crowd/css/index.css">
<script type="text/javascript" src="includes/system.js"></script>
<script type="text/javascript"
	src="/${project.build.finalName}/crowd/js/userInfo.js"></script>
<script type="text/javascript"
	src="/${project.build.finalName}/js/jquery-1.8.0.js"></script>



</head>
<body>


	<%
		if (null == cs236369.hw5.util.HTMLFilter.filter(request.getRemoteUser()))
		{
			return;
		}
		DbHandler db = new DbHandlerImp();
		DbUser user = db.getUserProfile(request.getRemoteUser());
	%>
	<div class="right">
		<h3>user details</h3>



		sir Name:<%=user.getSirName()%>
		<br />last Name:
		<%=user.getLastName()%>
		<br />user Name:
		<%=user.getUsername()%>
		<form action="#" method="POST">
			<br /> <input type="submit" value="delete User"
				onclick="deleteUser()" />
		</form>
	</div>



	<div class="left">
		<h4>List of User Messages:</h4>
		<table id="messageTable">
			<tr id="headers">
				<th>Messages</th>
				<th>Type of message</th>
				<th>Uploaded at</th>
				<th> </th>
			</tr>
			<%
				for (DbMessage m : user.getMsgs())
				{
			%>
			<tr>
				<td><%=m.getContent()%></td>
				<td><%=m.getType()%></td>
				<td><%=m.getDate()%></td>
				<td>
					<form action="#">
						<input type="button" value="delete Messasge"
							onclick="deleteMsg(this.form)" />
						<textarea id="msgId" name="msgId" hidden="true"><%=m.getId()%></textarea>

					</form>

				</td>
			</tr>

			<%
				}
			%>

		</table>

	</div>

</body>
</html>
